import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: '首页',
      component: () => import('@/views/HomePage.vue'),
    },
    {
      path: '/about',
      name: '关于',
      component: () => import('@/views/AboutPage.vue'),
    },
    {
      path: '/user/login',
      name: '用户登录',
      component: () => import('@/views/user/UserLoginPage.vue'),
    },
    {
      path: '/user/login/sms',
      name: '手机号登录',
      component: () => import('@/views/user/UserLoginByPhonePage.vue'),
    },
    {
      path: '/user/login/email',
      name: '邮箱登录',
      component: () => import('@/views/user/UserLoginByEmailPage.vue'),
    },
    {
      path: '/user/register',
      name: '用户注册',
      component: () => import('@/views/user/UserRegisterPage.vue'),
    },
    {
      path: '/user/chat/:roomId',
      name: '聊天大厅',
      component: () => import('@/views/user/UserChatPage.vue'),
      props: true,
    },
    {
      path: '/user/detail/:id',
      name: '用户详情页',
      component: () => import('@/views/user/UserDetailPage.vue'),
      props: true,
    },
    {
      path: '/user/edit/my',
      name: '修改资料',
      component: () => import('@/views/user/UserInfoEditPage.vue'),
    },
    {
      path: '/admin/user-manage',
      name: '用户管理',
      component: () => import('@/views/admin/UserManagePage.vue'),
    },
    {
      path: '/picture/add',
      name: '添加图片',
      component: () => import('@/views/picture/PictureAddPage.vue'),
    },
    {
      path: '/picture/ai/painting',
      name: 'AI扩图',
      component: () => import('@/views/picture/PictureAIPainting.vue'),
    },
    {
      path: '/picture/upload-batch',
      name: '批量上传图片',
      component: () => import('@/views/picture/PictureUploadByBatchPage.vue'),
    },
    {
      path: '/picture/add/batch',
      name: '批量导入图片',
      component: () => import('@/views/picture/PictureAddByBatchPage.vue'),
    },
    {
      path: '/picture/like-search',
      name: '批量导入图片',
      component: () => import('@/views/picture/PictureLikedSearchPage.vue'),
    },
    {
      path: '/admin/picture-manage',
      name: '管理图片',
      component: () => import('@/views/admin/PictureManagePage.vue'),
    },
    {
      path: '/picture/detail/:id',
      name: '查看图片详情',
      component: () => import('@/views/picture/PictureDetailPage.vue'),
      props: true,
    },
    {
      path: '/picture/search',
      name: '以图搜图',
      component: () => import('@/views/picture/PictureSearchPage.vue'),
    },
    {
      path: '/admin/space-manage',
      name: '管理空间',
      component: () => import('@/views/admin/SpaceManagePage.vue'),
    },
    {
      path: '/admin/space-manage-user/:id',
      name: '管理空间成员',
      component: () => import('@/views/admin/SpaceUserManagePage.vue'),
      props: true,
    },
    {
      path: '/space/add',
      name: '添加空间',
      component: () => import('@/views/space/SpaceAddPage.vue'),
    },
    {
      path: '/space/:id',
      name: '团队空间',
      component: () => import('@/views/space/SpaceMyPage.vue'),
      props: true,
    },
    {
      path: '/space/my',
      name: '我的空间',
      component: () => import('@/views/space/SpacePersonPage.vue'),
      props: true,
    },
    {
      path: '/space/analysis',
      name: '空间分析',
      component: () => import('@/views/analysis/SpaceAnalysisPage.vue'),
    },
    {
      path: '/contact',
      name: '联系我们',
      component: () => import('@/views/ContactUSPage.vue'),
    },

    //   匹配404
    {
      path: '/:catchAll(.*)',
      name: '404',
      component: () => import('@/views/NotFoundPage.vue'),
    },
    {
      path: '/picture/search/similar',
      name: '相似图片',
      component: () => import('@/views/picture/PictureSearchView.vue'),
    },
    {
      path: '/test/md',
      name: '测试md',
      component: () => import('@/views/test/MdTest.vue'),
    },
  ],
})

export default router
